package com.mt.api.modules.manager.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mt.api.modules.domain.AppNews;
import com.mt.api.modules.manager.INewsManager;
import com.mt.api.modules.mapper.AppNewsMapper;
import org.springframework.stereotype.Component;

/**
 * @Author: plover
 * @Date: 2022-01-02
 * @Description:
 */
@Component
public class NewsManagerImpl extends ServiceImpl<AppNewsMapper, AppNews> implements INewsManager {


    @Override
    public int saveNews(AppNews news) {
        return baseMapper.insert(news);
    }

    @Override
    public int updateNews(AppNews news) {
        return baseMapper.updateById(news);
    }

    @Override
    public AppNews getNewsById(Long id) {
        return baseMapper.selectById(id);
    }

}
